package init

import (
	"flag"
	"gateway/basic/config"
	__ "gateway/basic/proto"
	"google.golang.org/grpc"
	"google.golang.org/grpc/credentials/insecure"
	"log"
)

func InitsGrpc() {
	flag.Parse()
	addr := "127.0.0.1:50051"
	conn, err := grpc.NewClient(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
	if err != nil {
		log.Fatalf("did not connect: %v", err)
	}
	config.ClassClient = __.NewStreamGreeterClient(conn)
}
